//------------------------------------------------------------------------------
// The contents of this file are subject to the nopCommerce Public License Version 1.0 ("License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at  http://www.nopCommerce.com/License.aspx. 
// 
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. 
// See the License for the specific language governing rights and limitations under the License.
// 
// The Original Code is nopCommerce.
// The Initial Developer of the Original Code is NopSolutions.
// All Rights Reserved.
// 
// Contributor(s): _______. 
//------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Text;
using Tathata.Common.Caching;
using Microsoft.Practices.EnterpriseLibrary.Data;
using System.Data.Common;
using System.Data;
using System.Globalization;
using Tathata.Common.DAL;
using Tathata.Common.BLL.Entities;
using Tathata.Common.BLL.EntityCollections;
using Tathata.Common.DAL.Managers;

namespace Tathata.Common.BLL.Managers
{
    /// <summary>
    /// Message template manager
    /// </summary>
    public class MessageTemplateManager
    {
        #region Methods
        /// <summary>
        /// Gets a message template by template identifier
        /// </summary>
        /// <param name="MessageTemplateID">Message template identifier</param>
        /// <returns>Message template</returns>
        public static MessageTemplate GetByMessageTemplateID(int MessageTemplateID)
        {
            return MessageTemplateDBManager.GetByMessageTemplateID(MessageTemplateID);
        }

        /// <summary>
        /// Gets a message template by name
        /// </summary>
        /// <param name="Name">Message template name</param>
        /// <returns>Message template</returns>
        public static MessageTemplate GetByMessageTemplateName(string Name)
        {
            return MessageTemplateDBManager.GetByMessageTemplateName(Name);
        }

        /// <summary>
        /// Deletes a message template
        /// </summary>
        /// <param name="MessageTemplateID">Message template identifier</param>
        public static void DeleteMessageTemplate(int MessageTemplateID)
        {
            MessageTemplateDBManager.DeleteMessageTemplate(MessageTemplateID);
        }

        /// <summary>
        /// Gets all message templates
        /// </summary>
        /// <returns>Message template collection</returns>
        public static MessageTemplateCollection GetAllMessageTemplates()
        {
            return MessageTemplateDBManager.GetAllMessageTemplates();
        }
 
        /// <summary>
        /// Inserts a message template
        /// </summary>
        /// <param name="Name">The name</param>
        /// <param name="Subject">The subject</param>
        /// <param name="Body">The body</param>
        /// <returns>Message template</returns>
        public static MessageTemplate InsertMessageTemplate(string Name, string Subject, string Body)
        {
            return MessageTemplateDBManager.InsertMessageTemplate(Name, Subject, Body);
        }

        /// <summary>
        /// Updates the message template
        /// </summary>
        /// <param name="MessageTemplateID">The message template identifier</param>
        /// <param name="Name">The name</param>
        /// <param name="Subject">The subject</param>
        /// <param name="Body">The body</param>
        /// <returns>Message template</returns>
        public static MessageTemplate UpdateMessageTemplate(int MessageTemplateID,
            string Name, string Subject, string Body)
        {
            return MessageTemplateDBManager.UpdateMessageTemplate(MessageTemplateID, Name, Subject, Body);
        }
        #endregion
    }
}
